package com.blogspot.ostas.oracle.aq.spring;
 
import javax.jms.QueueConnectionFactory;
import javax.sql.DataSource;

import oracle.jms.AQjmsFactory;

import org.springframework.beans.factory.FactoryBean;
 
public class OracleAqQueueConnectionFactoryBean implements FactoryBean {
    private DataSource dataSource;   
     
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }
 
    @Override
    public Object getObject() throws Exception {
        return AQjmsFactory.getQueueConnectionFactory(dataSource);//ConnectionFactory(dataSource);
    }
 
    @Override
    public Class<?> getObjectType() {
        return QueueConnectionFactory.class;
    }
 
    @Override
    public boolean isSingleton() {
        return true;
    }
}
